package com.bitpay.cordova.qrscanner;

import android.util.Log;
import android.widget.Toast;

import com.yachtar.property.MainActivity;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;

public class MyFunction extends CordovaPlugin {

    public void calljava(String content){
        MainActivity.ins.read();
    }

    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        if("calljava".equals(action)){
            //speechSynthesize
            String content = args.getString(0);
            calljava(content);
            callbackContext.success("finish");//如果不调用success回调，则js中successCallback不会执行
            return true;
        }
        return false;
    }
}
